package com.pg_chat.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TxSmsService extends SmsServiceUtil {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    protected void init() {
        super.init();
    }

    @Override
    public boolean send(String phone, String msg) {
        MyReqBody reqBody = new MyReqBody();

        reqBody.setAccount(super.smsAccount);
        reqBody.setPassword(super.smsPwd);

        try{
            String result = httpPost(super.smsUrl,reqBody.requestBody());

            return true;
        }catch (Exception e){
            logger.error(String.valueOf(e));
            return false;
        }
    }

    @Override
    protected Boolean state4Respond(String respond, String mobiles) {
        return null;
    }

    @Override
    protected String stateCode(String rspcod) {
        return null;
    }

    class MyReqBody extends SmsRequest{

        @Override
        public String requestBody() {
            return null;
        }
    }
}
